class Game extends egret.DisplayObjectContainer {
	private bmc:BigMovieClip;
	private sp_bg:egret.Shape;
	private bmp:egret.Bitmap;

	private page1:Page1;
	private page2:Page2;
	private page3:Page3;
	private page4:Page4;
	private arr=[];
	private sc:ScrollContainer;


	public constructor() {
		super();

		this.page1=new Page1();
		this.page2=new Page2();
		this.page3=new Page3();
		this.page4=new Page4();
		this.arr.push(this.page3,this.page2,this.page1,this.page4); 

		this.sc=new ScrollContainer();
		this.sc.init(this.arr,1136,740);
		this.sc.addEventListener('scrollStart',this.scrollHandler,this);
		this.sc.addEventListener('scrollComplete',this.scrollHandler,this);
		this.addChild(this.sc);
		// this.addChild(this.page1);
		this.page3.In();

		this.alpha=0;
		egret.Tween.get(this).to({alpha:1},1000);
	}

	private scrollHandler(e:ScrollEvent):void
	{
		console.log(':::::::::::::::::::',e.type)
		if(e.type=='scrollStart')
		{
			console.log(':::::::::::::::::::',this.sc.pageIndex)
			this.sc.arr_child[this.sc.pageIndex].Out();
		}
		else if(e.type=='scrollComplete')
		{
			this.sc.arr_child[this.sc.pageIndex].In();
			
			if(this.sc.pageIndex==1)
			{
				
			}
			else if(this.sc.pageIndex==2)
			{
				
			}
			
		}
	}
}